package com.ys.everydaynews.utils

import android.content.Context

object SharedPreferencesUtils {
    private val TOKEN_STR = "save_token"

    fun saveToken(context: Context, key: String, value: String): Boolean {
        val preferences = context.getSharedPreferences(TOKEN_STR, Context.MODE_PRIVATE)
        val editor = preferences.edit()
        editor.putString(key, value)

        return editor.commit()
    }

    fun getSaveToken(context: Context, key: String): String? {
        val preferences=context.getSharedPreferences(TOKEN_STR,Context.MODE_PRIVATE)
        return preferences.getString(key,null)
    }
}